# -*- coding:utf-8 -*-
__author__ = 'benxing'
__date__ ="$2016-4-13 10:22:51$"


class BaseFunc(object):
    def __init__(self):
        return

    @staticmethod
    def formatkv2json(self,kv):
        if not isinstance(kv,dict):
            return

        result = kv
        for key in kv.keys():
            value = kv.get(key)
            if value is not None and not isinstance(value, str):
                value = str(value)
                result[key] = value


        # for key,value in kv:
        #     if value is not None and not isinstance(value,str):
        #         value = str(value)
        #         result[key] = value

        return result